package com.hnevc.gui;

import java.awt.BorderLayout;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class BorderLayoutDemo extends JFrame {

	JPanel p;
	JButton button1 ,button2 ,button3, button4 ,button5;
	public BorderLayoutDemo(){
		p = new JPanel(new BorderLayout());
		
		button1 = new JButton("按钮1");
		button2 = new JButton("按钮2");
		button3 = new JButton("按钮3");
		button4 = new JButton("按钮4");
		button5 = new JButton("按钮5");
		p.add(button1,BorderLayout.EAST);
		p.add(button2,BorderLayout.WEST);
		p.add(button3,BorderLayout.NORTH);
		p.add(button4,BorderLayout.SOUTH);
		p.add(button5,BorderLayout.CENTER);
		this.add(p);
		this.setLocation(200, 200);
		this.setSize(200, 200);
		this.setVisible(true);
	}
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		new BorderLayoutDemo();
	}

}
